yocto: Don't overwrite target with initial compose
authorColin Walters <walters@verbum.org>
Sat, 18 Feb 2012 16:21:17 +0000 (11:21 -0500)
committerColin Walters <walters@verbum.org>
Sat, 18 Feb 2012 16:21:17 +0000 (11:21 -0500)
The idea of creating the "initial compose" is it should be just that -
initial.  If we've later added stuff via ostbuild, we don't want to
overwrite it.  ostbuild will itself recompose from the base.

gnomeos/yocto/classes/gnomeos-contents.bbclass

index f51adec1e8c093916109b164aa9ab842f3212bdf..d84d08921c6f3e103df9ccc866f875230046db6a 100644 (file)
@@ -190,7 +190,10 @@ fakeroot do_rootfs () {
         fi
        ostree --repo=${repo} commit -s "${IMAGE_LINK_NAME}" --skip-if-unchanged "Build" -b ${base} --tree=tar=${DEPLOY_DIR_IMAGE}/${IMAGE_LINK_NAME}.tar.gz
        ostree --repo=${repo} diff "${base}" || true
-       ostree --repo=${repo} compose -s "Initial compose" -b ${buildroot} ${base}:/
+       # Create the initial root if it doesn't exist
+       if ! ostree --repo=${repo} rev-parse "${buildroot}" 2>/dev/null; then
+         ostree --repo=${repo} compose -s "Initial compose" -b ${buildroot} ${base}:/
+       fi
 }
 
 log_check() {